/**
 * 
 */
package info.pello.struts.tulebox.example;

/**
 * Action Class for enter Attributes
 * @author Raquel Valenzuela Ganuza
 *
 */
public class AttributesAction extends ExampleSupport {
	private Integer intelligence;
	private Integer strength;
	private Integer skill;
	private String result;
	
	/**
	 * execute method
	 * 
	 */
	public String execute() throws Exception {
    	Attributes attributes = new Attributes(this.intelligence, this.strength, this.skill);
    	
    	if(attributes.checkAttributes()){
    		result="Correct :)";
    		return SUCCESS;
    		
    	}else{
    		result="The total value of the parameters must be 30";
    		return ERROR;
    	}
    	
    }
	
	@Override
	public String input() throws Exception {
		// TODO Auto-generated method stub
		System.err.println("Input...");
		return super.input();
	}
	
	/**
	 * getIntelligence
	 * @return Intelligence
	 */
	public Integer getIntelligence() {
		return intelligence;
	}
	
	/**
	 * setIntelligence
	 * @param intelligence
	 */
	public void setIntelligence(Integer intelligence) {
		this.intelligence = intelligence;
	}
	
	/**
	 * getStrength
	 * @return Strength
	 */
	public Integer getStrength() {
		return strength;
	}
	
	/**
	 * setStrenght
	 * @param strength
	 */
	public void setStrength(Integer strength) {
		this.strength = strength;
	}
	
	/**
	 * getSkill
	 * @return Skill
	 */
	public Integer getSkill() {
		return skill;
	}
	
	/**
	 * setSkill
	 * @param skill
	 */
	public void setSkill(Integer skill) {
		this.skill = skill;
	}
	
	/**
	 * getResult
	 * @return Result
	 */
	public String getResult() {
		return result;
	}
	
	/**
	 * setResult
	 * @param result
	 */
	public void setResult(String result) {
		this.result = result;
	}
}
